#ifndef __MainMap_H__
#define __MainMap_H__

#include "cocos2d.h"
#include "Common.h"

USING_NS_CC;


class MainMap : public CommonScene
{
private:
	bool _readed = false;
	void ReadMap();
public:
	//RenderTexture* tex[8];

	typedef short MapArray[480][480];
	typedef Sprite* MapArrayS[480][480];
	static MapArray Earth, Surface, Building, BuildX, BuildY;

	std::vector<Sprite*> EarthS, SurfaceS, BuildingS, CloudS;

	Texture2D* texM[6000];

	EventKeyboard::KeyCode keypressing;

	int Mx, My;

	MainMap();
	~MainMap();

	virtual bool init();
	
	void Draw();

	void keyPressed(EventKeyboard::KeyCode keyCode, Event *event);
	void keyReleased(EventKeyboard::KeyCode keyCode, Event *event);

	void checkTimer(float dt);
	void loadTexture();

	CREATE_FUNC(MainMap);

	static Scene* createScene();

	void addNewSpriteIntoVector(std::vector<Sprite*> &v, int order = 0);
};

#endif

